package arrage;

import java.util.ArrayList;

public class arraylist_usual_ff {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        list.add("林泽霖");
        list.add("林颖超");
        System.out.println("添加林政佳这一动作是否成功"+ list.add("林政佳"));
        list.add("林子程");//添加林政佳这一动作是否成功true
        System.out.println(list);//[林泽霖, 林颖超, 林政佳, 林子程]

        String name=list.get(1);//第1位是林颖超
        System.out.println("第1位是"+name);

        String removename = list.remove(3);
        System.out.println("被删除的是"+removename);//被删除的是林子程
        System.out.println(list);

        int size=list.size();
        System.out.println("链表长度为"+size);//链表长度为3

        for (int i = 0; i < list.size(); i++) {
            System.out.println("第"+i+"位"+"是"+list.get(i));
        }//数组遍历
    }
}
